#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "version.h"
#include "fmod1-shared-ab.h"
#include "imod1-static-a.h"
#include "imod1-static-b.h"

#include "fmod2-shared-ab.h"
#include "imod2-static-a.h"
#include "imod2-static-b.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    IMod1SharedAB *iab1 = FMod1SharedAB::instance();
    IMod1StaticA  *ia1  = iab1->createStaticA();
    ia1->fun1();
    ia1->fun2();
    iab1->destoryStaticA(ia1);

    IMod1StaticB *ib1 = iab1->createStaticB();
    ib1->fun1();
    ib1->fun2();
    iab1->destoryStaticB(ib1);

    IMod2SharedAB *iab2 = FMod2SharedAB::instance();
    IMod2StaticA  *ia2  = iab2->createStaticA();
    ia2->fun1();
    ia2->fun2();
    iab2->destoryStaticA(ia2);

    IMod2StaticB *ib2 = iab2->createStaticB();
    ib2->fun1();
    ib2->fun2();
    iab2->destoryStaticB(ib2);
}

MainWindow::~MainWindow()
{
    delete ui;
}
